<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
            "http://www.w3.org/TR/REC-html40/loose.dtd">
<HTML>
<HEAD>



<META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<META name="GENERATOR" content="hevea 1.08">
<LINK rel="stylesheet" type="text/css" href="libman.css">
<TITLE>
Solver Specific Information
</TITLE>
</HEAD>
<BODY >
<A HREF="libman062.html"><IMG SRC ="previous_motif.gif" ALT="Previous"></A>
<A HREF="libman052.html"><IMG SRC ="contents_motif.gif" ALT="Up"></A>
<HR>

<H2 CLASS="section"><A NAME="htoc137">9.11</A>&nbsp;&nbsp;Solver Specific Information</H2><UL>
<LI><A HREF="libman063.html#toc76">Versions and Licences</A>
<LI><A HREF="libman063.html#toc77">Solver Differences</A>
<LI><A HREF="libman063.html#toc78">Access to External Solver's Control Parameters</A>
</UL>

<A NAME="specificsolver"></A>
The external solvers currently supported by the eplex library are:
<UL CLASS="itemize"><LI CLASS="li-itemize">
XPRESS-MP, a product of Dash Optimisation (www.dashoptimization.com)
<LI CLASS="li-itemize">CPLEX, a product of ILOG (www.ilog.com)
<LI CLASS="li-itemize">Solvers accessed via OSI, an Open Source solver interface of the
COIN-OR project (www.coin-or.org). Various solvers are supported via OSI
using the generic interface. The following are currently distributed:
<UL CLASS="itemize"><LI CLASS="li-itemize">
clpcbc: COIN-OR's CLP linear solver in combination with the CBC
branch and cut framework for MIP problems. The CLP solver may be compiled
with third-party open-source packages, such as University of Florida's 
AMD package (www.cise.ufl.edu/research/sparse/amd/), used by CLP barrier
solve. Eplex provides specialised
support for this combination, which enhance the features provided and
improve performance for solving larger MIP problems. 
<LI CLASS="li-itemize">symclp: COIN-OR's SYMPHONY MILP solver (with CLP as the linear
solver). Supported via the generic OSI API.
</UL>
</UL>
Both Dash and ILOG offer academic licences at discounted prices, or academic
partner programs.<BR>
<BR>
To load a specific solver explicitly, use:
<PRE CLASS="verbatim">
:- lib(eplex_cplex).
:- lib(eplex_xpress).
:- lib(eplex_osi_clpcbc). 
:- lib(eplex_osi_symclp). 
</PRE><A NAME="@default342"></A>
<A NAME="@default343"></A>
<A NAME="@default344"></A>
<A NAME="@default345"></A>
The first line explicitly requests the CPLEX solver, the second line
explicitly requests the XPRESS-MP solver. Note that these solvers must be
available for your machine for the above to work. The third line requests
the CLP/CBC solver, and the fourth line requests the SYMPHONY solver.<BR>
<BR>
<A NAME="toc76"></A>
<H3 CLASS="subsection"><A NAME="htoc138">9.11.1</A>&nbsp;&nbsp;Versions and Licences</H3>
All the solvers supported by the library come in various versions.
The set of supported solver versions may vary between different
releases of ECL<SUP><I>i</I></SUP>PS<SUP><I>e</I></SUP>; please refer to the release notes.
<BR>
<BR>
For commercial solvers, you may require solver licence to use the solver, and
depending on which solver licence you have (for the commercial solvers), 
which version of it, and which hardware and operating system,
you need to use the matching version of this interface.<SUP><A NAME="text7" HREF="libman052.html#note7">2</A></SUP>
Because an ECL<SUP><I>i</I></SUP>PS<SUP><I>e</I></SUP> installation can be shared between several
computers on a network, we have provided you with the possibility
to tell the system which licence you have on which machine.
To configure your local installation, simply add one line for
each computer with the appropriate licence to the file
<CODE>&lt;eclipsedir&gt;/lib/eplex_lic_info.ecl</CODE>, where <CODE>&lt;eclipsedir&gt;</CODE>
is the directory or folder where your ECL<SUP><I>i</I></SUP>PS<SUP><I>e</I></SUP> installation resides.
The file contains lines of the form
<BLOCKQUOTE CLASS="quote"> <PRE CLASS="verbatim">
licence(Hostname, Solver, Version, LicStr, LicNum).
</PRE></BLOCKQUOTE>
For example, if you have CPLEX version 7.5 on machine <CODE>workhorse</CODE>,
and XPRESS-MP version 15.20 (with the license file located in
<CODE>/my/xpress/license</CODE>) on machine <CODE>mule</CODE>, and your Internet
domain is <CODE>+icparc.ic.ac.uk</CODE>,
you would add the lines
<BLOCKQUOTE CLASS="quote"> <PRE CLASS="verbatim">
licence('workhorse.icparc.ic.ac.uk', cplex, '75', '', 0).
licence('mule.icparc.ic.ac.uk', xpress, '1520', '/my/xpress/license', 0).         
</PRE></BLOCKQUOTE>
The hostname must match the result of get_flag(hostname,H),
converted to an atom (this is normally the complete Internet domain name,
rather than just the machine).
Version is formed from the concatenation of the major and minor version
numbers. 
The meaning of LicStr and LicNum depends on the optimiser:
For an open source solver, both LicStr and LicNum are unused, as no license
is required.
For CPLEX with normal licenses, they are unused (the environment
variable <CODE>ILOG_LICENSE_FILE</CODE> should be set to the CPLEX
license file <CODE>access.ilm</CODE> as usual). 
For XPRESS-MP,
LicStr is a string specifying the directory where
licence file is located (overrides value of XPRESS environment
variable). LicNum is unused. If a machine has more than one licence and lib(eplex) is called, the
first one listed in <CODE>eplex_lic_info.ecl</CODE> will be used.<BR>
<BR>
<A NAME="toc77"></A>
<H3 CLASS="subsection"><A NAME="htoc139">9.11.2</A>&nbsp;&nbsp;Solver Differences</H3>

While the eplex library allows the user to write code in a
solver-independent way, there are differences between the solvers that
the user should be aware of:
<UL CLASS="itemize"><LI CLASS="li-itemize">
Different solvers may support different features. In particular,
solvers may support different methods of solving the problem, and solving
 of problems with a quadratic objective is not supported for all solvers.
At the very minimum, solvers must be able to solve (optimise) linear
 problems with a linear objective. Currently, all supported solvers can
 solve linear and MIP problems, with a Simplex solver.
<LI CLASS="li-itemize">Some features may be poorly supported by a particular solver, and
 some feature (such as the relaxed probe of 
<A HREF="../bips/lib/eplex/eplex_probe-2.html"><B>eplex_probe/2</B></A><A NAME="@default346"></A> may be
supported slightly differently).
<LI CLASS="li-itemize">Performance for specific problem may vary very significantly (orders
of magnitude) between different solvers. This does not necessarily indicate 
that one solver would consistently out perform another. In addition, the
different solvers may return a different optimal solution to specific
problems, i.e. with the same objective value, but different solution
values for the variables.
<LI CLASS="li-itemize">The solvers have different solver parameters to control/tune the
solver. These can be accessed from eplex, and is one of the only places
 where the user code may need to be solver specific.
</UL>

<H4 CLASS="subsubsection">CPLEX</H4>
CPLEX supports solving of linear and mixed integer problems, both with a
linear objective (LP and MILP), and also with a quadratic objective (QP and
MIQP). It supports various solving methods: simplex (primal and dual),
barrier, network simplex, and sifting. <BR>
<BR>
In recent versions of CPLEX, the relaxed and fixed probes are implemented 
by removing
the integer information from the problem and solving the relaxed problem,
and then adding the interger information back. This is because the CPLEX
API does not provide access to the root node of the MIP solve.<BR>
<BR>
CPLEX have only global parameters.<BR>
<BR>

<H4 CLASS="subsubsection">OSI</H4>
The features provided by eplex OSI is determined by the actual
solver(s) used via OSI, and to a lesser extent by what the OSI API
supports. The OSI API is mainly designed to support solving of 
linear and, to a lesser extent, MILP problems. However, for specific
solvers, in particular the CLP/CBC combination, eplex
directly access the solvers' own API to provide some functionality not
supportable via OSI. Note however the OSI API is constantly evolving and
improving, so some of the features may be directly supported via OSI in the
future. <BR>
<BR>
The sources for the porjects in COIN-OR can be downloaded from <TT>www.coin-or.org/download.html</TT>. 
Features <B>not</B> supported by OSI: 
<UL CLASS="itemize"><LI CLASS="li-itemize">
changing of solving method (it does support specifying if the problem
should be solved as a primal or dual)
<LI CLASS="li-itemize">problems with a quadratic objective function
<LI CLASS="li-itemize">time-outs from solving a problem.
<LI CLASS="li-itemize">obtaining detailed information about the MIP solving process,
especially when the MIP search was not complete, such as
the best MIP objective bound.
<LI CLASS="li-itemize">determining if an aborted solve have a suboptimal solution 
<LI CLASS="li-itemize">writing out a problem with a maximising objective function in LP or
MPS format.
<LI CLASS="li-itemize">writing out or reading in an quadratic objective function in LP or (extended)
MPS format.
<LI CLASS="li-itemize">use of Special Order Set (SOS)
<LI CLASS="li-itemize">extracting an IIS for an infeasible problem
</UL>

<H5 CLASS="paragraph">osi_clpcbc</H5> Supports primal, dual simplex and barrier (interior
point) methods for
solving linear and MIP problems with linear objective function, and linear
problems with a quadratic objective function. It also supports time-outs, and is better 
at determining the state of an aborted problem than using OSI on its own.
For the MIP related functionality, the MIP solver CBC is accessed directly
rather than through OSI, and this 
provides better MIP support: more information on the MIP
solver state is available, and a more sophisticated MIP search (based on
sample code supplied with CBC) than the default is performed, generally
leading to faster MIP solves.<BR>
<BR>
For the barrier/interior point method, CLP can take advantage of
third-party packages to order a sparse matrix prior to Cholesky
factorisation. Such packages are crucial to the performance of the
barrier method, and currently the binary distribution of CLP is compiled
with University of Florida's AMD (Approximate Minimum Degree ordering) 
package. The source for this package needs to be downloaded separately from
the COIN-OR project at <TT>www.cise.ufl.edu/research/sparse/amd/</TT>. <BR>
<BR>
A quadratic objective needs to be in postive semi-definite form, but
currently CLP does not check this, and the result of trying to solve a
problem with a quadratic objective not in positive semi-definite form
is undefined.<BR>
<BR>
The problem representation is stored by CLP, and one performance issue 
when using CLP is that incrementally adding new constraints to
a problem after solver setup can be expensive, as the whole problem has to
be copied and expanded for each addition. It is therefore more efficient to 
either post the constraints before problem setup, or add a large number of
constraints in one go, e.g. by using 
<A HREF="../bips/lib/eplex/eplex_add_constraints-3.html"><B>eplex_add_constraints/3</B></A><A NAME="@default347"></A>.
Unfortunately, this can be less memory efficient than incrementally adding
the constraints, if those constraints are only needed by eplex and not at
the ECL<SUP><I>i</I></SUP>PS<SUP><I>e</I></SUP> level.<BR>
<BR>

<H5 CLASS="paragraph">osi_symclp</H5> Supports primal and dual simplex methods for
solving linear and MILP problems. MILP is currently performed via the 
standard OSI API, and so has the same restrictions. Special Order Sets
(SOS) are not supported. Time-outs are not supported.<BR>
<BR>
Another restriction is due to SYMPHONY, which does not allow the objective
coefficients to be modified after a problem have been solved once. Thus the
objective changing probes are not supported.<BR>
<BR>

<H4 CLASS="subsubsection">XPRESS</H4>
XPRESS supports solving of linear and mixed integer problems, both with a
linear objective (LP and MILP), and also with a quadratic objective (QP and
MIQP). It supports simplex (primal and dual) and barrier solving methods.<BR>
<BR>
XPRESS does not maintain an optimisation direction with the problem;
instead it requires this to be specified each time the problem is
solved. As such, the optimisation direction, given in a LP format
specification of the problem, is ignored when a problem is read in, and
when writing a problem, minimisation is assumed. <BR>
<BR>
<A NAME="toc78"></A>
<H3 CLASS="subsection"><A NAME="htoc140">9.11.3</A>&nbsp;&nbsp;Access to External Solver's Control Parameters</H3>

The external solver has a number of control
parameters that affect the way it works.
These can be queried and modified using the
<A HREF="../bips/lib/eplex/lp_get-2.html"><B>lp_get/2</B></A><A NAME="@default348"></A>, 
<A HREF="../bips/lib/eplex/eplex_get-2.html"><B>eplex_get/2</B></A><A NAME="@default349"></A>,
<A HREF="../bips/lib/eplex/lp_get-3.html"><B>lp_get/3</B></A><A NAME="@default350"></A>, and
<A HREF="../bips/lib/eplex/lp_set-2.html"><B>lp_set/2</B></A><A NAME="@default351"></A>, 
<A HREF="../bips/lib/eplex/eplex_set-2.html"><B>eplex_set/2</B></A><A NAME="@default352"></A>, 
<A HREF="../bips/lib/eplex/lp_set-3.html"><B>lp_set/3</B></A><A NAME="@default353"></A> predicates respectively:<BR>
<BR>

<H4 CLASS="subsubsection"><A HREF="../bips/lib/eplex/lp_get-3.html"><B>lp_get(+Handle, optimizer_param(+ParamName), -Value)</B></A><A NAME="@default354"></A></H4>
Retrieve the value of a control parameter for the external solver for the
problem represented by Handle. These
parameters are solver specific; see
<A HREF="../bips/lib/eplex/lp_get-3.html"><B>lp_get/3</B></A><A NAME="@default355"></A> for more details..<BR>
<BR>

<H4 CLASS="subsubsection"><A HREF="../bips/lib/eplex/eplex_get-2.html"><B>EplexInstance:eplex_get(optimizer_param(+ParamName), -Value)</B></A><A NAME="@default356"></A></H4>
Like lp_get/3, but get a control parameter for the external solver
associated with the specified eplex instance. <BR>
<BR>

<H4 CLASS="subsubsection"><A HREF="../bips/lib/eplex/lp_get-2.html"><B>lp_get(optimizer_param(+ParamName), -Value)</B></A><A NAME="@default357"></A></H4>
Retrieve the global value of a control parameter for the external solver. The
parameters and the exact meaning of `global' is solver specific: if the
solver does not have global parameters, this gets the global default value,
rather than the globally applicable value. The parameters are as in lp_get/3.<BR>
<BR>

<H4 CLASS="subsubsection"><A HREF="../bips/lib/eplex/lp_set-3.html"><B>lp_set(+Handle, optimizer_param(+ParamName), +Value)</B></A><A NAME="@default358"></A></H4>
Set a control parameter for the external solver for the problem represented
by Handle. If the external solver does not have problem specific
parameters, this will raise an unimplemented functionality exception. 
The parameters are as in lp_get/3.<BR>
<BR>

<H4 CLASS="subsubsection"><A HREF="../bips/lib/eplex/eplex_set-2.html"><B>EplexInstance:eplex_set(optimizer_param(+ParamName), +Value)</B></A><A NAME="@default359"></A></H4>
Like lp_set/3, but set a control parameter for the external solver
associated with the specified eplex instance. <BR>
<BR>

<H4 CLASS="subsubsection"><A HREF="../bips/lib/eplex/lp_set-2.html"><B>lp_set(optimizer_param(+ParamName), +Value)</B></A><A NAME="@default360"></A></H4>
Set a control parameter for the external solver for the problem globally.
If the external solver does not have global parameters, this will set the
global default for the parameter. The parameters are as in lp_get/3.<BR>
<BR>

<H4 CLASS="subsubsection"><A HREF="../bips/lib/eplex/lp_get-2.html"><B>lp_get(optimizer, -Value)</B></A><A NAME="@default361"></A>
and <A HREF="../bips/lib/eplex/lp_get-2.html"><B>lp_get(optimizer_version, -Value)</B></A><A NAME="@default362"></A></H4>
Retrieve the name (currently 'cplex', 'xpress' or 'osi') and version of the 
external optimizer.
This can be used to write portable code even when using solver-specific settings:
<PRE CLASS="verbatim">
\begin{verbatim}
    ( lp_get(optimizer, xpress) -&gt;
        lp_set(Handler, optimize_param(maxnode), 100)
    ; lp_get(optimizer, cplex) -&gt;
        lp_set(Handler, optimize_param(node_limit), 100)
    ; lp_get(optimizer, osi) -&gt;
        (lp_get(optimizer_version, clpcbc) -&gt; 
             lp_set(Handler, optimize_param(node_limit), 100)
        ;
             true
        )
    ), ...
</PRE>
<A NAME="@default363"></A>
<A NAME="@default364"></A>
<A NAME="@default365"></A>
<A NAME="@default366"></A>
<A NAME="@default367"></A>
<HR>
<A HREF="libman062.html"><IMG SRC ="previous_motif.gif" ALT="Previous"></A>
<A HREF="libman052.html"><IMG SRC ="contents_motif.gif" ALT="Up"></A>
</BODY>
</HTML>
